
#include "rtthread.h"
#include "bsp.h"

void bsp_init(void)
{
	rt_pin_mode(PIN_SYSTEM_LED, PIN_MODE_OUTPUT);
	rt_pin_mode(PIN_NET_LED, PIN_MODE_OUTPUT);
	rt_pin_mode(PIN_FAULT_LED, PIN_MODE_OUTPUT);
	rt_pin_mode(PIN_L306_RESET, PIN_MODE_OUTPUT);

	/* 系统灯常亮 */
	rt_pin_write(PIN_SYSTEM_LED, PIN_LOW);
	/* 网络灯默认灭 */
	rt_pin_write(PIN_NET_LED, PIN_HIGH);
	/* 故障灯默认灭 */
	rt_pin_write(PIN_FAULT_LED, PIN_HIGH);
	/* L306复位脚默认高电平(L306端) */
	rt_pin_write(PIN_L306_RESET, PIN_LOW);
}

void bsp_l306_reset(void)
{
	rt_pin_write(PIN_L306_RESET, PIN_HIGH);
	rt_thread_mdelay(50);
	rt_pin_write(PIN_L306_RESET, PIN_LOW);
}

